﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tetris
{
    class Tetromino
    {
        //                         Index/Position/X/Y
        public bool[, , ,] Tetro = new bool[7, 4, 4, 4];
        /*private int[] figure1 = new int[] { 0, 0, 1, 0, 
                                            0, 0, 1, 0, 
                                            0, 1, 1, 0, 
                                            1, 1, 0, 0 };*/
 
        public void tetromino()
        {
            for (int i = 0; i < 7; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    for (int k = 0; k < 4; k++)
                    {
                        for (int l = 0; l < 4; l++)
                        {
                            Tetro[i, j, k, l] = false;   
                        }   
                    }
                }
            }

            /*for (int i = 0; i < figure1.Length; i++)
            {
                int row = i / 4;
                int col = i % 4;

                if (figure1[i] == 1)
                    Tetro[0, 0, row, col] = true;
                else
                    Tetro[0, 0, row, col] = false;
            }*/


            for (int i = 0; i < 4; i++)
            {
                Tetro[0, 0, 2, i] = true;
                Tetro[0, 1, i, 1] = true;
            }
            for (int i = 0; i < 3; i++)
            {
                Tetro[1, 0, i + 1, 0] = true; // <Figur1>
                Tetro[1, 0, 1, 1] = true;

                Tetro[1, 1, 2, i] = true;
                Tetro[1, 1, 3, 2] = true;

                Tetro[1, 2, i + 1, 1] = true;
                Tetro[1, 2, 3, 0] = true;

                Tetro[1, 3, 3, i] = true;
                Tetro[1, 3, 2, 0] = true; // </Figur1>

                Tetro[2, 0, i + 1, 0] = true; // <Figur2>
                Tetro[2, 0, 3, 1] = true;

                Tetro[2, 1, 2, i] = true;
                Tetro[2, 1, 3, 0] = true;

                Tetro[2, 2, i + 1, 1] = true;
                Tetro[2, 2, 1, 0] = true;

                Tetro[2, 3, 3, i] = true;
                Tetro[2, 3, 2, 2] = true; // </Figur2>

                Tetro[6, 0, i + 1, 0] = true; // <Figur6>
                Tetro[6, 0, 2, 1] = true;

                Tetro[6, 1, 2, i] = true;
                Tetro[6, 1, 3, 1] = true;

                Tetro[6, 2, i + 1, 1] = true;
                Tetro[6, 2, 2, 0] = true;

                Tetro[6, 3, 3, i] = true;
                Tetro[6, 3, 2, 1] = true; // </Figur6>                   
            }
            for (int i = 0; i < 2; i++)
            {
                Tetro[3, 0, 2, i] = true; // <Figur3>
                Tetro[3, 0, 3, i] = true; // </Figur3>

                Tetro[4, 0, i + 1, 0] = true; // <Figur4>
                Tetro[4, 0, i + 2, 1] = true;

                Tetro[4, 1, 2, i + 1] = true;
                Tetro[4, 1, 3, i] = true; // </Figur4>

                Tetro[5, 0, i + 2, 0] = true; // <Figur5>
                Tetro[5, 0, i + 1, 1] = true;

                Tetro[5, 1, 2, i] = true;
                Tetro[5, 1, 3, i+1] = true; // </Figur5>
            }
            
        }
    }
}
